/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

.ouiFilterButton {
  background-color: $ouiFormBackgroundColor;
  height: $ouiFormControlHeight;
  width: auto;
  border: 1px solid $ouiFormBorderColor;
  border-right: none;
  font-size: $ouiFontSizeS;

  &:disabled {
    color: $ouiButtonColorDisabledText;
    pointer-events: none;

    .ouiFilterButton__notification {
      opacity: .5;
    }
  }

  &:hover:not(:disabled),
  &:focus:not(:disabled) {
    // Remove underline from whole button so notifications don't get the underline
    text-decoration: none;

    .ouiFilterButton__textShift {
      // Add put it only on the actual text part
      text-decoration: underline;
    }
  }
}

.ouiFilterButton-hasActiveFilters {
  font-weight: $ouiFontWeightBold;
}

.ouiFilterButton--hasIcon .ouiButtonEmpty__content {
  justify-content: space-between;
}

.ouiFilterButton--withNext + .ouiFilterButton {
  margin-left: $ouiSizeXS * -1;
  border-left: none;
}

.ouiFilterButton-isSelected {
  background-color: $ouiColorLightestShade;
}

.ouiFilterButton__text-hasNotification {
  display: flex;
  align-items: center;
}

.ouiFilterButton__notification {
  margin-left: $ouiSizeS;
  vertical-align: text-bottom;
}

.ouiFilterButton__textShift {
  @include ouiTextShift;
  @include ouiTextTruncate;
  min-width: $ouiSize * 3;
}
